home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Snippets / Files / PBDTGetAppl / Source / InitMac.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-07  |  1.0 KB  |  58 lines  |  [TEXT/KAHL]

  1. /*
  2.     9-30-92  • Brigham Stevens
  3.     --------------------------
  4.  
  5.     This file contains the standard witch chant for getting the Mac going
  6. */
  7.  
  8. /* Need this header file because we set the WNE flag */
  9. #include "EventLoop.h"
  10.  
  11.  
  12.  
  13. #define    _Unimplemented 0xA89F
  14. #define    _WaitNextEvent 0xA860
  15.  
  16. Boolean TrapAvailable ( short tNum, short tType)
  17. {
  18.     return ( NGetTrapAddress(tNum,tType) != GetTrapAddress(_Unimplemented) );
  19. }
  20.  
  21. Boolean WNEIsImplemented()
  22. {
  23.     SysEnvRec    theWorld;
  24.     
  25.     SysEnvirons(1,&theWorld);
  26.     if (theWorld.machineType < 0)
  27.         return false;
  28.     else
  29.         return TrapAvailable ( _WaitNextEvent, ToolTrap);
  30. }
  31.  
  32.  
  33.  
  34. InitToolBox(short numberOfMasters)
  35. /*
  36.     pass the number of times you want MoreMasters to be called
  37.     if your app has lots of Handles to allocate
  38.     then call MoreMasters lots of times.
  39. */
  40. {
  41.     
  42.     InitGraf(&thePort);
  43.     InitFonts();
  44.     InitWindows();
  45.     InitMenus();
  46.     InitCursor();
  47.     TEInit();
  48.     FlushEvents(everyEvent, 0);
  49.     InitDialogs(nil);
  50.     
  51.     while(numberOfMasters--)
  52.         MoreMasters();
  53.         
  54.     MaxApplZone();
  55.  
  56.     WNE_available = WNEIsImplemented();
  57. }
  58.